Skip to content

fix: improve text selection visibility in dark code editor on light theme#5369

Open
ageev wants to merge 1 commit intoNginxProxyManager:developfrom
ageev:fix/light-theme-editor-selection-visibility
Open

fix: improve text selection visibility in dark code editor on light theme#5369
ageev wants to merge 1 commit intoNginxProxyManager:developfrom
ageev:fix/light-theme-editor-selection-visibility

Conversation

@ageev
Copy link

@ageev ageev commented Mar 2, 2026

Summary

  • When using the light theme, text selected (highlighted with mouse) in the Custom Nginx Configuration editor is nearly invisible because the browser's light-mode ::selection color blends with the dark editor background
  • Added an explicit ::selection style (#264f78) for the .w-tc-editor-text textarea when data-bs-theme="light" is active
  • The fix applies to all five components using the dark code editor: NginxConfigField, LocationsFields, DNSProviderFields, EventDetailsModal, and DefaultSite

Root cause

The code editor (@uiw/react-textarea-code-editor) uses data-color-mode="dark" to force a dark background, but the app's color-scheme: light CSS property (set in App.css for the light theme) causes the browser to use light-mode default selection colors. This results in light-colored selection highlights on a dark background with light text — making selections invisible.

Test plan

  • Switch to light theme in NPM settings
  • Open any Proxy Host → Edit → Custom Nginx Configuration
  • Select text with mouse — selection should now be clearly visible (blue highlight)
  • Verify the same fix works in Custom Locations advanced config, DNS Provider credentials, Event Details modal, and Default Site custom HTML editor
  • Switch to dark theme and verify text selection still works correctly (unaffected by this change)

…heme

When using the light theme, text selected in the Custom Nginx Configuration
editor (and other dark-themed code editors) was nearly invisible because the
browser's light-mode selection color blended with the dark editor background.

This adds an explicit ::selection style for the editor textarea that provides
sufficient contrast on the dark background. The fix applies to all five
components using the dark code editor: NginxConfigField, LocationsFields,
DNSProviderFields, EventDetailsModal, and DefaultSite.
@ageev ageev force-pushed the fix/light-theme-editor-selection-visibility branch from c5dd06d to 255d894 Compare March 2, 2026 19:59
@nginxproxymanagerci
Copy link

Docker Image for build 2 is available on DockerHub:

nginxproxymanager/nginx-proxy-manager-dev:pr-5369

Note

Ensure you backup your NPM instance before testing this image! Especially if there are database changes.
This is a different docker image namespace than the official image.

Warning

Changes and additions to DNS Providers require verification by at least 2 members of the community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant